[#assign menucode="orderPayList"]
[#assign PayMode = {"0" : "线下支付", "1" : "快钱在线支付", "2" : "浙商在线支付", "3" : "平安银行在线支付"}]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<title>订单对账流水</title>
<link href="/res/css/respective/order/back-order.css" rel="stylesheet">
</head>
<body>
[#-- ispurchaser是否是采购商 --]
[#assign ispurchaser = Session.currentRole.roleType == 1]
	<div class="warp [#if !ispurchaser]warp-supplier[/#if]">
	[#include "/front/common/front_headAzt.html"]
         <div class="backcontent">
         [#include "/front/common/front_leftAzt.html"]
            <div class="back-main">
            	<div class="inner">
                	 <div class="title">[#if ispurchaser]付[#else]收[/#if]款明细 </div>
                	 <form id="orderPaidForm" action="/order/paidList" method="get">
                	 	<!-- 当前页码 -->
	                	<input type="hidden" id="pageNo" name="pageNo" value="${page.pageNum!}">
	                    <div class="back-status"> 
	                     	<input type="text" id="keyword" name="keyword" value="${queryParam.keyword!}" placeholder="请输入订单编号" class="orderInput orderInput1" />
	                        <span>
	                        	<label>[#if ispurchaser]卖[#else]买[/#if]家名称：</label> 
	                        	<input type="text" class="orderInput orderInput2" 
	                        		[#if ispurchaser]id="sellerCompanyName" name="sellerCompanyName" value="${queryParam.sellerCompanyName!}"
				                    [#else]id="buyerCompanyName" name="buyerCompanyName" value="${queryParam.buyerCompanyName!}"[/#if]/>
				            </span>
	                        <span>交易时间：<input type="text" class="orderInput dateInput" id="sdate" name="sdate" value="${queryParam.sdate!}"/> - <input type="text" class="orderInput dateInput" id="edate" name="edate" value="${queryParam.edate!}" /></span>
	                    	<a href="javascript:search()">搜索</a>
	                    </div>
                     </form>
                     <p class="mb10"><b>已[#if ispurchaser]付[#else]收[/#if]款金额：<span class="orange">￥${totalPrice!?string('0.00')}</span></b></p>

                    [#if orderPayList?? && orderPayList?size > 0]
                     <div class="dataTable dataTable2">
                     	<table>
                        	<tbody>
                            	<tr>
                                	<th>时间</th>
                                    <th>[#if ispurchaser]卖家[#else]买家[/#if]</th>
                                    <th>订单编号</th>
                                    <th width="130">金额</th>
                                    <th width="130">支付方式</th>
                                    <th width="130">详情</th>
                                </tr>
                                [#list orderPayList as orderPay]
                                <tr>
                                	<td>${(orderPay.payTime?string("yyyy-MM-dd HH:mm:ss"))!}</td>
                                    <td>[#if ispurchaser]${CommonUtil.getSimpleStr(orderPay.sellerCompanyName, 20)}[#else]${CommonUtil.getSimpleStr(orderPay.buyerCompanyName, 20)}[/#if]</td>
                                    <td>${orderPay.orderNumber!}</td>
                                    <td><b class="orange">￥${orderPay.totalPrice!?string('0.00')}</b></td>
                                    <td>[#if orderPay.payMode??]${PayMode[orderPay.payMode?string]!}[/#if]</td>
                                    <td><a href="/order/payDetail/${orderPay.orderId!}" target="_blank">查看详情</a></td>
                                </tr>
                               	[/#list]
                            </tbody>
                        </table>
                     </div>
                     <div class="backpage">
						共${page.total!}条记录<span class="orange">${page.pageNum!}</span> / ${page.pages!}
	                    <p>
	                        <input type="text" id="gotoPage"/>
	                        <a href="javascript:void(0)" class="go" onclick="goto($('#gotoPage').val())">GO</a>
	                    </p>
	                    <div class="pnt">
	                        <a href="javascript:void(0)" class="prev" onclick="pre()"></a>
	                        <a href="javascript:void(0)" class="next" onclick="next()"></a>
	                    </div>
               		 </div>
                    [#else]
                        <div style="text-align: center">当前没有任何财务信息~</div>
                    [/#if]
                </div>
            </div>
         </div>
   	[#include "/front/common/front_footerAzt.html"] 
    </div>
<script type="text/javascript" src="/res/js/common/jquery.1.9.1.min.js"></script>
<script type="text/javascript" src="/res/js/structure/struture.js"></script>
<script type="text/javascript" src="/res/js/common/common.js"></script>
<script type="text/javascript" src="/res/third/laydate/laydate.js"></script>
<script type="text/javascript" src="/res/third/layer/layer.js"></script>
<script type="text/javascript">
	$(function(){
		$(".back-main .inner").css("minHeight",$(window).height()-200);
		initDate();
	})
	
	//日期选择控件初始化
    function initDate() {
        var start = {
            elem: '#sdate',
            format: 'YYYY-MM-DD',
        [#if queryParam.edate??]
            max : '${queryParam.edate}',
        [/#if]
            choose: function(datas){
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas;//将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#edate',
            format: 'YYYY-MM-DD',
        [#if queryParam.sdate??]
            min : '${queryParam.sdate}',
            start : '${queryParam.sdate}',
        [/#if]
            choose: function(datas){
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);
    }
	
	 function search() {
        $('#pageNo').val(1);
        $('#orderPaidForm').submit();
    }

    function next() {
        goto(Number($('#pageNo').val()) + 1);
    }

    function pre() {
        goto(Number($('#pageNo').val()) - 1);
    }

    function goto(pageNo) {
        if(pageNo >= 1 && pageNo <= ${page.pages!}) {
            $('#pageNo').val(pageNo);
            $('#orderPaidForm').submit();
        }
    }
</script>
</body>
</html>
